package com.hunray.rent.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.TableGenerator;

@Entity
@Table(name="t_device_back")
public class DeviceBack {

	private Integer id;
	
	private Device device;
	
	private Back back;

	@Id
	@GeneratedValue(strategy = GenerationType.TABLE, generator = "tg_device_back")
	@TableGenerator(name = "tg_device_back", table = "t_id", pkColumnName = "f_table", pkColumnValue = "t_device_back", valueColumnName = "f_id", allocationSize = 1, initialValue = 1)
	@Column(name = "f_id")
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="f_device")
	public Device getDevice() {
		return device;
	}

	public void setDevice(Device device) {
		this.device = device;
	}

	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="f_back")
	public Back getBack() {
		return back;
	}

	public void setBack(Back back) {
		this.back = back;
	}
	
	
	
}

